import {createApp} from 'vue'
import './style.css'
import 'virtual:svg-icons-register'
import btnAntiShake from '@/plugins/btnAntiShake'
import App from './App.vue'
import {initPinia} from './store';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//添加事件管理者 'passive'，以使页面更加流畅
//Chrome51 版本以后，Chrome 增加了新的事件捕获机制－Passive Event Listeners
import 'default-passive-events'

//聊天插件
import chat from 'vue3-beautiful-chat'

//水印
// import watermark from './utils/watermark';

//引入 el-message 和 el-loading 的css样式文件
import 'element-plus/theme-chalk/el-loading.css'
import 'element-plus/theme-chalk/el-message.css'
import 'element-plus/theme-chalk/el-message-box.css'
import 'element-plus/theme-chalk/el-notification.css'
import 'vue3-video-play/dist/style.css'

import {initRouter} from './router'

const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
//初始化路由
initRouter(app);
//初始化vuex
initPinia(app);
//全局注册svg  已经自动导入这里不需要再注册
// app.component('svg-icon', svgIcon)
app.use(btnAntiShake)
app.use(chat)
app.mount('#app');
